﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Transaction.aspx.cs" Inherits="App.Transaction" Theme="Alpha" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <h1>Přehled</h1>
        <asp:Label ID="LabelInfo" runat="server" Font-Bold="True" Visible="false"/>
        <asp:Repeater ID="RepeaterTeamMembers" runat="server">
            <HeaderTemplate>               
            </HeaderTemplate>
            <ItemTemplate>
                <div class="creditLine">
                <ajaxToolkit:Gravatar  ID="ImageAvatar3" runat="server" DefaultImageBehavior="Identicon" Email="<%#GetMemberEmail(Container.DataItem)%>" DefaultImage="<%#GetMemberAvatar(Container.DataItem)%>" CssClass="detailTeamAvatar"/>
                <span class="nick"><asp:LinkButton ID="LinkButtonUserInfo1" runat="server" CommandArgument="<%#GetMemberID(Container.DataItem)%>" OnClick="LinkButtonUserInfo_Click"><%#GetMemberNick(Container.DataItem)%></asp:LinkButton></span>
                <span class="credit"><%#Eval("Credit")%> Kč</span>
                <%--<span class="charge">Nabít kredit</span>--%>
                </div>
            </ItemTemplate>
        </asp:Repeater>
        <h1 style="margin-top: 35px;">Změna kreditu na účtu</h1>
        <div class="formSelect">
            <asp:Label ID="Label1" runat="server" Text="Hráč: "></asp:Label>
            <asp:DropDownList ID="DropDownListPlayers" runat="server">
            </asp:DropDownList>
        </div>
        <div class="formField">
            <asp:Label ID="Label2" runat="server" Text="Částka: (Kč)"></asp:Label>
            <asp:TextBox ID="TextBoxCharge" runat="server" MaxLength="9" ></asp:TextBox>
            
        </div>
            <div class="formField">
            <asp:Label ID="Label3" runat="server" Text="Popis: "></asp:Label>
            <asp:TextBox ID="TextBoxDescription" runat= "server" MaxLength="100"></asp:TextBox>
        </div>
        
        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TextBoxCharge" FilterType="Custom" ValidChars="-0123456789"></ajaxToolkit:FilteredTextBoxExtender>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  ErrorMessage="Číslo má špatný formát" ControlToValidate="TextBoxCharge" ValidationExpression="^(-)?\d+$"></asp:RegularExpressionValidator >
        <br />
        <div class="formButton">
            <asp:Button ID="ButtonCharge" runat="server" Text="Nabít" onclick="ButtonCharge_Click" />
        </div>
        <h1 style="margin-top: 35px;">Požadavky o navýšení kreditu</h1>
        <asp:Repeater ID="RepeaterChargeRequests" runat="server">
            <HeaderTemplate>
                <%--<h4>Příchozí požadavky čekající na potvrzení</h4>--%>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="detailTeam">
                    <ajaxToolkit:Gravatar ID="ImageAvatar3" runat="server" DefaultImageBehavior="Identicon" Email="<%#GetUserEmail(Container.DataItem)%>" DefaultImage="<%#GetUserAvatar(Container.DataItem)%>" CssClass="detailTeamAvatar"/>
                    <div class="detailRequest creditRequest">
                        <span class="nick">
                            <asp:LinkButton ID="LinkButtonTeamLeader" runat="server" Text='<%#GetUserName(Container.DataItem)%>' CommandArgument='<%#Eval("UserID")%>' OnClick="LinkButtonUserInfo_Click"/>
                        </span>
                        <span class="ammount"><%#Eval("ChargeRequest") %> Kč</span>
                        <span class="actions">
                            <asp:LinkButton ID="LinkButtonConfirm" runat="server" CommandArgument='<%#Eval("ChargeID")%>' OnClick="LinkButtonConfirm_Click">přijmout</asp:LinkButton>
                            -
                            <asp:LinkButton ID="LinkButtonCancel" runat="server" CommandArgument='<%#Eval("ChargeID")%>' OnClick="LinkButtonCancel_Click">zrušit</asp:LinkButton>
                        </span>
                    </div>
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </asp:Panel> 
</asp:Content>
